/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JLoginPanel.java
 *
 * Created on 2011-03-04, 15:23:16
 */

package guzik.lukasz.SnpLoginEngine;

/**
 *
 * @author Łukasz 'byku' Guzik
 */
public class JLoginPanel extends javax.swing.JPanel {

    /** Creates new form JLoginPanel */
    public JLoginPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLoginField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jPasswordField = new javax.swing.JPasswordField();
        jInfoLabel = new javax.swing.JLabel();

        jLabel1.setText(org.openide.util.NbBundle.getMessage(JLoginPanel.class, "JLoginPanel.jLabel1.text")); // NOI18N

        jLoginField.setText(org.openide.util.NbBundle.getMessage(JLoginPanel.class, "JLoginPanel.jLoginField.text")); // NOI18N

        jLabel2.setText(org.openide.util.NbBundle.getMessage(JLoginPanel.class, "JLoginPanel.jLabel2.text")); // NOI18N

        jPasswordField.setText(org.openide.util.NbBundle.getMessage(JLoginPanel.class, "JLoginPanel.jPasswordField.text")); // NOI18N

        jInfoLabel.setText(org.openide.util.NbBundle.getMessage(JLoginPanel.class, "JLoginPanel.jInfoLabel.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLoginField, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
                            .addComponent(jPasswordField, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)))
                    .addComponent(jInfoLabel))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLoginField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jInfoLabel)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jInfoLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    javax.swing.JTextField jLoginField;
    javax.swing.JPasswordField jPasswordField;
    // End of variables declaration//GEN-END:variables


    String getUsername()
    {
	return jLoginField.getText();
    }
    
    String getPassword()
    {
	return new String(jPasswordField.getPassword());
    }

    void setInfo(String newInfo)
    {
	jInfoLabel.setText(newInfo);
    }
}
